<?php

include_once('./common.php');
include_once (S_ROOT . './source/function_user.php');

//获取方法
$ac = empty($_GET['ac'])?'':$_GET['ac'];

//允许的方法
$acs = array('index', 'class');
if(empty($ac) || !in_array($ac, $acs)) {
	$ac = "class";
}

//判断是否登陆
if ($_POST['ac'] == 'login' || empty($_SESSION['user']['adminUid']))
{
	include_once(S_ROOT.'./source/admin_login.php');
	exit;
}

// 判断是否已经在别处登录
if ($_SESSION['user']['adminUid']){
    $param = array(
            'do' => 'getAdminUser',
            'format' => 'json',
            'adminUid' => $_SESSION['user']['adminUid'],
    );
    
    $content  = get_api_content($_SC ['apiurl'], $param);
    $content = json_decode($content);
    if ($content->errorNo){
        unset($_SESSION);
        include_once(S_ROOT.'./source/admin_login.php');
        exit;
    }
}
//链接
$theurl = 'planner.php?ac='.$ac;
include_once(S_ROOT.'./source/planner_'.$ac.'.php');

?>